# -*- coding: utf-8 -*-

def unorderedEqual(sequence1, sequence2):
    """
    Test whether two sequences have same items, not regarding the order
    """
    sorted1 = sorted(sequence1)
    sorted2 = sorted(sequence2)
    return sorted1 == sorted2

class FixedValueProvider():
    """
    Callable class that provides fixed value on call. For mocking purposes.
    """
    def __init__(self, value):
        self.value = value

    def __call__(self, *args, **kwargs):
        return self.value


def identity(value):
    return value

class PropertyBag():
    def __init__(self, **kwargs):
        self.__dict__ = kwargs

def urlRepresentation(value):
    if value is True:
        return 'True'
    elif value is False:
        return 'False'

def boolFromUrl(string):
    if string in ('0', 'False'):
        return False
    else:
        return True
